package com.itheima.d5_enum;

public enum B {
    X(){
        @Override
        public void go() {
            System.out.println("X");
        }
    },Y("张三"){
        @Override
        public void go() {
            System.out.println(getName()+"再跑~~");
        }
    };

    private String name;


    private B(){
    }
    private B(String name){
        this.name = name;
    }

    public String getName(){
        return name;
    }


    //抽象枚举

    public abstract void go();
}
